<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"
	isELIgnored="false"%>
<%@ include file="/WEB-INF/common/path.jsp"%>
<%@ include file="/WEB-INF/common/tag.jsp"%>
<html>
<head>
 <base href="${basePath}">
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>本地生活购物</title>
 <script type="text/javascript" src="${path }/js/resource/jquery.js"></script>
  <script type="text/javascript" src="${path }/js/resource/serviceTopicList.js"></script>
 </head>
 <body>
 <div align="center"><div><h1>本地生活购物</h1></div>
 <div>
 <!-- 分类浏览 -->
	 <div>
	<div>一级分类:<s:if test="firstCate == null"><span style="background-color: red;"><a href="${path }/topic/serviceList" >全部</a></span>&nbsp;&nbsp;&nbsp;</s:if>
		<s:else><span ><a href="${path }/topic/serviceList" >全部</a></span>&nbsp;&nbsp;&nbsp;</s:else>
		<s:iterator value="firstCates" var="cate">
			<s:if test="firstCate.categoryNumber == categoryNumber"><span style="background-color: red;"><a href="${path }/topic/serviceList?cid=${categoryNumber }" >${name }</a></span>&nbsp;&nbsp;&nbsp;</s:if>
			<s:else><span><a href="${path }/topic/serviceList?cid=${categoryNumber }" >${name }</a></span>&nbsp;&nbsp;&nbsp;</s:else>
		</s:iterator></div>
		
		<div>二级分类:<s:if test="secondCate == null"><span style="background-color: red;"><a href="${path }/topic/serviceList?cid=${firstCate.categoryNumber}" >全部</a></span>&nbsp;&nbsp;&nbsp;</s:if>
		<s:else><span ><a href="${path }/topic/serviceList?cid=${firstCate.categoryNumber}" >全部</a></span>&nbsp;&nbsp;&nbsp;</s:else>
		<s:iterator value="secondCates" var="cate">
			<s:if test="secondCate.categoryNumber == categoryNumber"><span style="background-color: red;"><a href="${path }/topic/serviceList?cid=${categoryNumber }" >${name }</a></span>&nbsp;&nbsp;&nbsp;</s:if>
			<s:else><span><a href="${path }/topic/serviceList?cid=${categoryNumber }" >${name }</a></span>&nbsp;&nbsp;&nbsp;</s:else>
		</s:iterator></div>
		
		<div>三级分类:<s:if test="thirdCate == null"><span style="background-color: red;"><a href="${path }/topic/serviceList?cid=${secondCate.categoryNumber}" >全部</a></span>&nbsp;&nbsp;&nbsp;</s:if>
		<s:else><span ><a href="${path }/topic/serviceList?cid=${secondCate.categoryNumber}" >全部</a></span>&nbsp;&nbsp;&nbsp;</s:else>
		<s:iterator value="thirdCates" var="cate">
			<s:if test="thirdCate.categoryNumber == categoryNumber"><span style="background-color: red;"><a href="${path }/topic/serviceList?cid=${categoryNumber }" >${name }</a></span>&nbsp;&nbsp;&nbsp;</s:if>
			<s:else><span><a href="${path }/topic/serviceList?cid=${categoryNumber }" >${name }</a></span>&nbsp;&nbsp;&nbsp;</s:else>
		</s:iterator></div>
		<div>
			<span>关键字搜索：<input name="keyword" value="${q }" /><input type="button" value="search" name="search"/></span>
		</div>
		<!-- 排序 -->
		<div>排序方式:<s:if test="sort == 1"><span style="background-color: red;"><a href="${path }/topic/serviceList?cid=${cid }&q=${q }&sort=1" ">主题帖热度降序</a></span></s:if>&nbsp;&nbsp;&nbsp;
			<s:else><span><a href="${path }/topic/serviceList?cid=${cid }&q=${q }&sort=1" ">主题帖热度降序</a></span>&nbsp;&nbsp;&nbsp;</s:else>
		<s:if test="sort == 2"><span style="background-color: red;"><a href="${path }/topic/serviceList?cid=${cid }&q=${q }&sort=2" ">最新主题帖</a></span></s:if>
			<s:else><span><a href="${path }/topic/serviceList?cid=${cid }&q=${q }&sort=2" ">最新主题帖</a></span></s:else>
		</div>
	 </div>
 <!-- topic浏览 -->
	 <div><div><h3>主题帖列表</h3></div>
	 	<div id="topicListDiv">
	 		<table>
	 			<s:iterator value="topicList" var = "topic">
	 				<tr><td><a href="${path }/topic/topicDetail?tid=${id }" target="_blank"/><img src="${path }/${product.productMainPicture}" height="200" width="200"/>${product.productName }</a></td><td>id=${id }</td><td>topicTitle=${ topicTitle}</td><td>${topicString }</td><td>time:<s:date name="topicCreateDate" format="yyyy-MM-dd HH:mm:ss" /></td><td>用户：${topicUserName }</td><td>热度：${topicHot }</td><td>brand:${product.productBrand }</td><td>pid:${productId }</td></tr>
	 			</s:iterator>
	 		</table>
	 	</div>
	 	<!-- 分页div -->
	 	 <input type="hidden" name="page" value="${page }">
	 	 <input type="hidden" name="pageSize" value=${pageSize }>
  		<input type="hidden" name="hasNextPage" value="${hasNextPage }">
  		<input type="hidden" name="type" value="${type }">
  		<input type="hidden" name="categoryNumber" value="${cid }">
	 	 <div id="pageDiv">
  <s:if test="hasNextPage==1  && page > 1">
  		<input type="button" name="prevPage" value="上一页">当前第<span style="color:red" id="pageNumSpan">${page }</span>页<input type="button" name="nextPage" value="下一页" >
  	</s:if>
  	<s:elseif test="hasNextPage == 0 && page > 1">
  		<input type="button" name="prevPage" value="上一页">当前第<span style="color:red" id="pageNumSpan">${page }</span>页><input type="button" name="nextPage" value="下一页" disabled="disabled">
  	</s:elseif>
  		<s:elseif test="hasNextPage ==1 && page == 1">
  		<input type="button" name="prevPage" value="上一页" disabled="disabled">当前第<span style="color:red" id="pageNumSpan">${page }</span>页<input type="button" name="nextPage" value="下一页">
  	</s:elseif>
  	<s:elseif test="hasNextPage == 0 && page == 1">
  		<input type="button" name="prevPage" value="上一页" disabled="disabled">当前第<span style="color:red" id="pageNumSpan">${page }</span>页<input type="button" name="nextPage" value="下一页" disabled="disabled">
  	</s:elseif>
  </div>
	 	
	 </div>	
 </div>
</div>
 </body>
 </html>